% Chakram is a subproject of Hexena - Haskell Executable Analyser
% License:			GPL-3
% Maintainer:		Montez Fitzpatrick
% Stability:		Experimental
% Portability:		GHC
% Module:			Hexena.Codec.Parser.ExportDirectory

Export Directory Format

\begin{code}
module Hexena.Codec.Parser.ExportDirectory (parseExportDirectory) where

import Data.Binary.Get
import Data.Word
import Data.Label -- Needs 'fclabels'

import Hexena.Data.ExportDirectory (ExportDirectory(..))

-- | Descriptions derived from WINNT.H
parseExportDirectory :: Get ExportDirectory
parseExportDirectory = do
    ed_characteristics <- getWord32le
    ed_timeDateStamp <- getWord32le
    ed_majorVersion <- getWord16le
    ed_minorVersion <- getWord16le
    ed_name <- getWord32le
    ed_base <- getWord32le
    ed_numberOfFunctions <- getWord32le
    ed_numberOfNames <- getWord32le
    ed_addressOfFunctions <- getWord32le
    ed_addressOfNames <- getWord32le
    ed_addressOfNameOrdinals <- getWord32le

    return $ ExportDirectory ed_characteristics ed_timeDateStamp ed_majorVersion ed_minorVersion ed_name ed_base ed_numberOfFunctions ed_numberOfNames ed_addressOfFunctions ed_addressOfNames ed_addressOfNameOrdinals 

\end{code}
